package com.system.runtai.controller;


import com.system.common.result.Result;
import com.system.runtai.entity.Community;
import com.system.runtai.service.CommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * <p>
 * 行业社区 前端控制器
 * </p>
 *
 * @author runtai
 * @since 2024-03-29
 */
@Api(tags = "行业社区")
@RestController
@RequestMapping("/runtai/community")
public class CommunityController {

    @Autowired
    private CommunityService communityService;


    @ApiOperation(value = "行业社区LOGO修改")
    @PostMapping("/updateCommunity")
    public Result<Community> updateCommunity(@RequestBody Community community){
        community.setUpdateTime(LocalDateTime.now());
        boolean b = communityService.updateById(community);

        if (b){
            return Result.ok(community).message("修改成功");
        }
        return Result.fail(community).message("修改失败");
    }



}

